package io;

import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.IOException;

/**
 * 文件复制
 */
public class CopyDemo {
    public static void main(String[] args) throws IOException {
        FileInputStream fis = new FileInputStream("qqaazz.jpg");
        FileOutputStream fos = new FileOutputStream("sss.jpg");

        int d;
        long start = System.currentTimeMillis();
        while ((d = fis.read()) != -1) {
            fos.write(d);

        }
        System.out.println("复制完毕");
        long end = System.currentTimeMillis();
         long time =end-start;
        System.out.println("用时"+time+"毫秒");
        fis.close();
        fos.close();
    }
}
